﻿@model PagedList.IPagedList<VehicleOOBWeb.Models.Vehicle>


@{
    ViewBag.Title = "Sản phẩm theo hãng " + (ViewBag.Manu as VehicleOOBWeb.Models.Manufacturer).manufacturer_name;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section featured {
    <div class="header2">
        <img class="right" src="/images/heder_bg.gif" alt="" />
        <h2 class="header2">Hãng xe</h2>
    </div>
}

<div class="box">
    <div class="box-header">
        <span class="title">@((ViewBag.Manu as VehicleOOBWeb.Models.Manufacturer).manufacturer_name)</span>
    </div>
    <div class="box-content">
        <ul>
            @foreach (var item in Model)
            {
                <li>
                    <a href="/Vehicle/Details/?vehicle_id=@item.vehicle_id" title="@item.name">
                        <img alt="@item.name" border="0" src="@item.image" title="@item.name" width="240" />
                    </a>
                    <h2><a href="/Vehicle/Details/?vehicle_id=@item.vehicle_id" title="@item.name">@item.name</a>
                    </h2>
                    <span style="color: black;">
                        <b>Giá: <i style="color: #AA0000">@item.price</i></b>
                    </span>
                    <p>

                        @item.description
                    </p>
                    @VehicleOOBWeb.HtmlHelperExtensions.Cart(item.vehicle_id, User.Identity.IsAuthenticated, Request.Url.ToString())
                </li>               
            }

        </ul>
    </div>
    <div style="clear: both"></div>
</div>

@if (Model.PageCount > 1)
{
    @:<div class="pager">
@:Trang 
        if (Model.HasPreviousPage)
        {
            @Html.ActionLink("<<", "Index", new { manufacturer_code = Request.Params["manufacturer_code"], page = 1 })
            @Html.Raw(" ");
            @Html.ActionLink("<", "Index", new { manufacturer_code = Request.Params["manufacturer_code"], page = Model.PageNumber - 1 })
            @Html.Raw(" ");
        }
        else
        {
            @:<<
            @Html.Raw(" ");
            @:<   
        }
        @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) @Html.Raw("/") @Model.PageCount

        if (Model.HasNextPage)
        {
            @Html.Raw(" "); 
            @Html.ActionLink(">", "Index", new { manufacturer_code = Request.Params["manufacturer_code"], page = Model.PageNumber + 1 })
            @Html.Raw(" "); 
            @Html.ActionLink(">>", "Index", new { manufacturer_code = Request.Params["manufacturer_code"], page = Model.PageCount })
        }
        else
        {
            @:>
            @Html.Raw(" ")
            @:>>   
        }
    @:</div>
}